From ec69b6f0131939ebfbff1d5082b1229f7b58799b Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 21 Sep 2024 11:08:50 +0700
Subject: <iman> add try catch

---
 src/pages/shop/checkout/[status].jsx | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

(limited to 'src/pages/shop/checkout/[status].jsx')

diff --git a/src/pages/shop/checkout/[status].jsx b/src/pages/shop/checkout/[status].jsx
index 2c3bebcf..3e390e8d 100644
--- a/src/pages/shop/checkout/[status].jsx
+++ b/src/pages/shop/checkout/[status].jsx
@@ -1,22 +1,22 @@
-import BasicLayout from '@/core/components/layouts/BasicLayout'
-import IsAuth from '@/lib/auth/components/IsAuth'
-import FinishCheckoutComponent from '@/lib/checkout/components/FinishCheckout'
-import { useRouter } from 'next/router'
-import axios from 'axios'
-import Seo from '@/core/components/Seo'
+import BasicLayout from '@/core/components/layouts/BasicLayout';
+import IsAuth from '@/lib/auth/components/IsAuth';
+import FinishCheckoutComponent from '@/lib/checkout/components/FinishCheckout';
+import { useRouter } from 'next/router';
+import axios from 'axios';
+import Seo from '@/core/components/Seo';
 
 export async function getServerSideProps(context) {
-  const { order_id } = context.query
-  await axios.post(
-    `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/finish-checkout?orderName=${order_id}`,
-    {},
-    { headers: context.req.headers }
-  )
-  return { props: {} }
+  const { order_id } = context.query;
+  // await axios.post(
+  //   `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/finish-checkout?orderName=${order_id}`,
+  //   {},
+  //   { headers: context.req.headers }
+  // )
+  return { props: {} };
 }
 
 export default function Finish() {
-  const router = useRouter()
+  const router = useRouter();
 
   return (
     <>
@@ -28,5 +28,5 @@ export default function Finish() {
         </BasicLayout>
       </IsAuth>
     </>
-  )
+  );
 }
-- 
cgit v1.2.3


From 6832012bb3a7a694852a4eb453f3ff8fe6a0300b Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Sat, 21 Sep 2024 11:12:35 +0700
Subject: <iman> update code

---
 src/pages/shop/checkout/[status].jsx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

(limited to 'src/pages/shop/checkout/[status].jsx')

diff --git a/src/pages/shop/checkout/[status].jsx b/src/pages/shop/checkout/[status].jsx
index 3e390e8d..0d5cffe8 100644
--- a/src/pages/shop/checkout/[status].jsx
+++ b/src/pages/shop/checkout/[status].jsx
@@ -7,11 +7,11 @@ import Seo from '@/core/components/Seo';
 
 export async function getServerSideProps(context) {
   const { order_id } = context.query;
-  // await axios.post(
-  //   `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/finish-checkout?orderName=${order_id}`,
-  //   {},
-  //   { headers: context.req.headers }
-  // )
+  await axios.post(
+    `${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/finish-checkout?orderName=${order_id}`,
+    {},
+    { headers: context.req.headers }
+  );
   return { props: {} };
 }
 
-- 
cgit v1.2.3

